<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>风险预警分发</title>
    <script src="../../js/header.js"></script>
</head>
<body>
<div v-cloak id="app">
    <div style="margin-top: 10px;">
        <div style="margin-top: 10px;border-bottom:1px solid rgba(200,200,200,0.43);">
            <el-form :model="selectForm" :rules="rules" ref="selectForm" label-width="150px">
                <el-row>
                    <el-col :span="10">
                        <el-form-item label="预警领域:" prop="" label-width="130px">
                            <el-select v-model="selectForm.fxyjDomainId" placeholder="请选择"
                                       :disabled="selectFormDisabled">
                                <el-option label="综合监管" value="10"></el-option>
                                <el-option label="自然资源" value="20"></el-option>
                                <el-option label="生态环境" value="30"></el-option>
                                <el-option label="交通运输" value="40"></el-option>
                                <el-option label="农业农村" value="50"></el-option>
                                <el-option label="文化旅游" value="60"></el-option>
                                <el-option label="卫生健康" value="70"></el-option>
                                <el-option label="市场监管" value="80"></el-option>
                                <el-option label="食品监管" value="90"></el-option>
                                <el-option label="药品监管" value="0"></el-option>
                                <el-option label="安全生产" value="1"></el-option>
                                <el-option label="金融监管" value="2"></el-option>
                                <el-option label="网信安全" value="3"></el-option>
                                <el-option label="社会保障" value="4"></el-option>
                                <el-option label="税务税收" value="5"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col span="10">
                        <el-form-item label="风险预警标题:" prop="" label-width="130px">
                            <el-input v-model="selectForm.fxyjTitle" placeholder=""
                                      :disabled="selectFormDisabled"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col span="10">
                        <el-form-item label="风险级别:" prop="" label-width="130px">
                            <el-select v-model="selectForm.fxyjLevel" placeholder="请选择" :disabled="selectFormDisabled">
                                <el-option label="高风险" value="0"></el-option>
                                <el-option label="中高风险" value="1"></el-option>
                                <el-option label="中风险" value="2"></el-option>
                                <el-option label="低风险" value="3"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="监管对象名称:" prop="" label-width="130px">
                            <el-input v-model="selectForm.fxyjObjectName" placeholder=""
                                      :disabled="selectFormDisabled"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="10">
                        <el-form-item label="预警传送时间:" prop="" label-width="130px">
                            <el-date-picker
                                    v-model="selectForm.startTime1"
                                    type="date"
                                    value-format="yyyy-MM-dd"
                                    placeholder="开始时间"
                                    style="width: 160px;"
                                    :editable="false"
                                    :disabled="selectFormDisabled">
                            </el-date-picker>
                            <span style="color: rgb(192, 204, 218);text-align: center;">—</span>
                            <el-date-picker
                                    v-model="selectForm.endTime1"
                                    type="date"
                                    value-format="yyyy-MM-dd"
                                    placeholder="结束时间"
                                    style="width: 160px;"
                                    :editable="false"
                                    :disabled="selectFormDisabled">
                            </el-date-picker>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="预警生成时间:" prop="" label-width="130px">
                            <el-date-picker
                                    v-model="selectForm.startTime"
                                    type="date"
                                    value-format="yyyy-MM-dd"
                                    placeholder="开始时间"
                                    style="width: 160px;"
                                    :editable="false"
                                    :disabled="selectFormDisabled">
                            </el-date-picker>
                            <span style="color: rgb(192, 204, 218);text-align: center;">—</span>
                            <el-date-picker
                                    v-model="selectForm.endTime"
                                    type="date"
                                    value-format="yyyy-MM-dd"
                                    placeholder="结束时间"
                                    style="width: 160px;"
                                    :editable="false"
                                    :disabled="selectFormDisabled">
                            </el-date-picker>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row style="margin-bottom: 30px;">
                    <div style="float: right;">
                        <el-button type="primary" size="small" style="width: 60px;height: 30px;"
                                   @click="searchForm('selectForm')">查询
                        </el-button>
                        <el-button type="warning" size="small" style="width: 60px;height: 30px;"
                                   @click="resetForm('selectForm')">重置
                        </el-button>
                        <el-button type="primary" size="small" style="width: 60px;height: 30px;" @click="appovalEx()">
                            导出
                        </el-button>
                    </div>
                </el-row>
            </el-form>
        </div>

        <!--展示列表-->
        <el-table :data="tableData" border style="width: 100%;margin-top: 35px;"
                  :header-cell-style="{background:'#eef1f6',color:'#606266'}">
            <!--<el-table-column type="selection"></el-table-column>-->
            <el-table-column
                    prop=""
                    type="index"
                    label="序号"
                    width="50"
                    align="center">
            </el-table-column>
            <el-table-column
                    prop="fxyjDomainId"
                    label="预警领域"
                    width="100"
                    align="center">
                <template slot-scope="scope">
                    <span v-if="scope.row.fxyjDomainId==10">综合监管</span>
                    <span v-if="scope.row.fxyjDomainId==20">自然资源</span>
                    <span v-if="scope.row.fxyjDomainId==30">生态环境</span>
                    <span v-if="scope.row.fxyjDomainId==40">交通运输</span>
                    <span v-if="scope.row.fxyjDomainId==50">农业农村</span>
                    <span v-if="scope.row.fxyjDomainId==60">文化旅游</span>
                    <span v-if="scope.row.fxyjDomainId==70">卫生健康</span>
                    <span v-if="scope.row.fxyjDomainId==80">市场监管</span>
                    <span v-if="scope.row.fxyjDomainId==90">食品监管</span>
                    <span v-if="scope.row.fxyjDomainId==0">药品监管</span>
                    <span v-if="scope.row.fxyjDomainId==1">安全生产</span>
                    <span v-if="scope.row.fxyjDomainId==2">金融监管</span>
                    <span v-if="scope.row.fxyjDomainId==3">网信安全</span>
                    <span v-if="scope.row.fxyjDomainId==4">社会保障</span>
                    <span v-if="scope.row.fxyjDomainId==5">税务税收</span>
                </template>
            </el-table-column>
            <el-table-column
                    prop="fxyjTitle"
                    label="预警标题"
                    width="150"
                    align="center">
            </el-table-column>
            <el-table-column
                    prop="fxyjDesc"
                    label="预警描述"
                    width="200"
                    align="center">
            </el-table-column>
            <el-table-column
                    prop="fxyjLevel"
                    label="预警级别"
                    width="100"
                    align="center">
                <template slot-scope="scope">
                    <span v-if="scope.row.fxyjLevel==0">高风险</span>
                    <span v-if="scope.row.fxyjLevel==1">中高风险</span>
                    <span v-if="scope.row.fxyjLevel==2">中风险</span>
                    <span v-if="scope.row.fxyjLevel==3">低风险</span>
                </template>
            </el-table-column>
            <el-table-column
                    prop="fxyjTime"
                    label="预警生成时间"
                    width="80"
                    align="center">
            </el-table-column>
            <el-table-column
                    prop="fxyjTransmitTime"
                    label="预警传送时间"
                    width="80"
                    align="center">
            </el-table-column>
            <el-table-column
                    prop="getTime"
                    label="认领时间"
                    width="160"
                    align="center">
            </el-table-column>
            <el-table-column
                    prop="fxyjObjectName"
                    label="监管对象名称"
                    width="160"
                    align="center">
            </el-table-column>
            <el-table-column
                    prop="dealState"
                    label="处置状态"
                    width="100"
                    align="center">
                <template slot-scope="scope">
                    <span v-if="scope.row.dealState==''||scope.row.dealState==null ">待接收</span>
                    <span v-if="scope.row.dealState==1">已接收</span>
                    <span v-if="scope.row.dealState==2">已分发</span>
                    <span v-if="scope.row.dealState==3">已反馈</span>
                    <span v-if="scope.row.dealState==4">已结束</span>
                </template>
            </el-table-column>
            <el-table-column
                    label="操作"
                    width="300"
                    align="center">
                <template slot-scope="scope">
                    <el-button type="primary" size="mini" v-show="(scope.row.dispenseState!='1')?true:false"
                               @click="distribute(scope.$index,scope.row)">分发
                    </el-button>
                    <el-button size="mini" v-show="(scope.row.dispenseState!='1')?false:true"
                               @click="view(scope.$index,scope.row)">查看详情
                    </el-button>
                </template>
            </el-table-column>
        </el-table>
        <div style="overflow: hidden;">
            <div class="pagination">
                <el-pagination
                        @size-change="handleSizeChange"
                        @current-change="handleCurrentChange"
                        :current-page="currentPage"
                        :page-sizes="[10, 20, 30, 40]"
                        :page-size="pagesize"
                        background
                        layout="total, sizes,prev, pager, next"
                        :total="tableTotal"
                        prev-text="上一页"
                        next-text="下一页">
                </el-pagination>
            </div>
        </div>

        <!--查看详情-->
        <el-dialog title="" :visible.sync="dialogViewForm" center fullscreen>
            <div style="margin-top: 10px;">
                <el-form :model="riskwarningview" ref="riskwarningview" label-width="150px">
                    <!--风险预警基本信息-->
                    <div>
                        <el-row>
                            <el-col :span="10" class="tab-title">
                                风险预警基本信息
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="风险预警唯一ID:" label-width="150px">
                                    <el-input v-model="riskwarningview.riskwarning.fxyjId" placeholder=""
                                              :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="领域ID及名称:" label-width="150px">
                                    <el-select v-model="riskwarningview.riskwarning.fxyjDomainId" placeholder="请选择"
                                               :disabled="formDisabled">
                                        <el-option label="综合监管" value="10"></el-option>
                                        <el-option label="自然资源" value="20"></el-option>
                                        <el-option label="生态环境" value="30"></el-option>
                                        <el-option label="交通运输" value="40"></el-option>
                                        <el-option label="农业农村" value="50"></el-option>
                                        <el-option label="文化旅游" value="60"></el-option>
                                        <el-option label="卫生健康" value="70"></el-option>
                                        <el-option label="市场监管" value="80"></el-option>
                                        <el-option label="食品监管" value="90"></el-option>
                                        <el-option label="药品监管" value="0"></el-option>
                                        <el-option label="安全生产" value="1"></el-option>
                                        <el-option label="金融监管" value="2"></el-option>
                                        <el-option label="网信安全" value="3"></el-option>
                                        <el-option label="社会保障" value="4"></el-option>
                                        <el-option label="税务税收" value="5"></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="风险线索所属模型ID:" label-width="150px">
                                    <el-input v-model="riskwarningview.riskwarning.fxyjModelId" placeholder=""
                                              :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="监管对象类型:" label-width="150px">
                                    <el-input v-model="riskwarningview.riskwarning.fxyjObjectType" placeholder=""
                                              :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="行政区划代码:" label-width="150px">
                                    <el-input v-model="riskwarningview.riskwarning.fxyjAreaNumber" placeholder=""
                                              :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="行政区划名称:" label-width="150px">
                                    <el-input v-model="riskwarningview.riskwarning.fxyjAreaName" placeholder=""
                                              :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="监管对象ID:" label-width="150px">
                                    <el-input v-model="riskwarningview.riskwarning.fxyjObjectId" placeholder=""
                                              :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="监管对象名称:" label-width="150px">
                                    <!--<el-select v-model="riskwarningview.riskwarning.fxyjObjectName" placeholder="请选择"
                                               :disabled="formDisabled">
                                        <el-option label="行政相对人（组织）" value="1"></el-option>
                                        <el-option label="行政相对人（个人）" value="2"></el-option>
                                        <el-option label="特种设备" value="3"></el-option>
                                        <el-option label="特定产品" value="4"></el-option>
                                        <el-option label="场地场所" value="5"></el-option>
                                        <el-option label="项目工程" value="6"></el-option>
                                        <el-option label="特定行为" value="7"></el-option>
                                        <el-option label="特定活动" value="8"></el-option>
                                    </el-select>-->
                                    <el-input v-model="riskwarningview.riskwarning.fxyjObjectName" placeholder=""
                                              :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="平台名称:" label-width="150px">
                                    <el-input v-model="riskwarningview.riskwarning.fxyjPlatform" placeholder=""
                                              :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="平台网址:" label-width="150px">
                                    <el-input v-model="riskwarningview.riskwarning.fxyjWeb" placeholder=""
                                              :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="16">
                                <el-form-item label="预警描述:" label-width="150px">
                                    <el-input v-model="riskwarningview.riskwarning.fxyjDesc" placeholder=""
                                              :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="16">
                                <el-form-item label="风险预警详情:">
                                    <el-input type="textarea" v-model="riskwarningview.riskwarning.fxyjProps"
                                              placeholder="" :disabled="formDisabled" style="width: 100%;"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="预警级别:" label-width="150px">
                                    <el-select v-model="riskwarningview.riskwarning.fxyjLevel" placeholder="请选择"
                                               :disabled="formDisabled">
                                        <el-option label="高风险" value="0"></el-option>
                                        <el-option label="中高风险" value="1"></el-option>
                                        <el-option label="中风险" value="2"></el-option>
                                        <el-option label="低风险" value="3"></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="预警时间:" label-width="150px">
                                    <el-date-picker
                                            v-model="riskwarningview.riskwarning.fxyjTime"
                                            type="date"
                                            value-format="yyyy-MM-dd"
                                            placeholder="选择时间"
                                            style="width: 243px;"
                                            :editable="false"
                                            :disabled="formDisabled">
                                    </el-date-picker>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="其他:" label-width="150px">
                                    <el-input v-model="riskwarningview.riskwarning.fxyjOthers" placeholder=""
                                              :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="预警详情网址:" label-width="150px">
                                    <el-input v-model="riskwarningview.riskwarning.fxyjDetailUrl" placeholder=""
                                              :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </div>
                    <!--接收处置信息-->
                    <div>
                        <el-row>
                            <el-col :span="10" class="tab-title">
                                接收处置信息
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="风险预警传送时间:" label-width="150px">
                                    <el-input v-model="riskwarningview.riskwarning.fxyjTransmitTime" placeholder=""
                                              :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="从应急部发送过来的时间:" label-width="150px">
                                    <el-input v-model="riskwarningview.riskwarning.yjbSendTime" placeholder=""
                                              :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>

                    </div>
                    <!--分发到的机构-->
                    <div>
                        <el-row>
                            <el-col :span="10" class="tab-title">
                                分发信息
                            </el-col>
                        </el-row>
                        <div v-for="(item,index) in riskwarningview.riskwarningChildren">
                            <el-row>
                                <el-col :span="8">
                                    <el-form-item label="操作人:" label-width="150px">
                                        <el-input v-model="item.operatePerson" placeholder=""
                                                  :disabled="formDisabled"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="操作人机构:" label-width="150px">
                                        <el-input v-model="item.operateOrg" placeholder=""
                                                  :disabled="formDisabled"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="8">
                                    <el-form-item label="处置结果:" label-width="150px">
                                        <el-select v-model="item.disposeResult" placeholder="请选择"
                                                   :disabled="formDisabled">
                                            <el-option label="认领" value="0"></el-option>
                                            <el-option label="分发" value="1"></el-option>
                                            <el-option label="回复" value="2"></el-option>
                                            <el-option label="结束" value="3"></el-option>
                                        </el-select>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="分发时间:" label-width="150px">
                                        <el-date-picker
                                                v-model="item.fenfaTime"
                                                type="date"
                                                value-format="yyyy-MM-dd"
                                                placeholder="选择开始时间"
                                                style="width: 243px;"
                                                :editable="false"
                                                :disabled="formDisabled">
                                        </el-date-picker>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="16">
                                    <el-form-item label="处置说明:">
                                        <el-input type="textarea" v-model="item.disposeExplain" placeholder=""
                                                  :disabled="formDisabled" style="width: 100%;"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="16">
                                    <el-form-item label="分发到的机构:">
                                        <el-input v-model="item.fenfaToOrg" placeholder=""
                                                  :disabled="formDisabled"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </div>
                    </div>
                </el-form>
            </div>
        </el-dialog>

        <!--编辑详情-->
        <el-dialog title="" :visible.sync="dialogEditForm" center fullscreen>
            <div style="margin-top: 10px;">
                <el-form :model="riskwarningEdit" :prop="riskwarningEdit" :rules="rules" ref="riskwarningEdit"
                         label-width="150px">
                    <!--风险预警基本信息-->
                    <div>
                        <el-row>
                            <el-col :span="10" class="tab-title">
                                风险预警基本信息
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="风险预警唯一ID:" prop="jgFxyjAcquire.fxyjId" label-width="150px">
                                    <el-input v-model="riskwarningEdit.jgFxyjAcquire.fxyjId" placeholder=""
                                              :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="领域ID及名称:" prop="jgFxyjAcquire.fxyjDomainId" label-width="150px">
                                    <el-select v-model="riskwarningEdit.jgFxyjAcquire.fxyjDomainId" placeholder="请选择"
                                               :disabled="formDisabled">
                                        <el-option label="综合监管" value="10"></el-option>
                                        <el-option label="自然资源" value="20"></el-option>
                                        <el-option label="生态环境" value="30"></el-option>
                                        <el-option label="交通运输" value="40"></el-option>
                                        <el-option label="农业农村" value="50"></el-option>
                                        <el-option label="文化旅游" value="60"></el-option>
                                        <el-option label="卫生健康" value="70"></el-option>
                                        <el-option label="市场监管" value="80"></el-option>
                                        <el-option label="食品监管" value="90"></el-option>
                                        <el-option label="药品监管" value="0"></el-option>
                                        <el-option label="安全生产" value="1"></el-option>
                                        <el-option label="金融监管" value="2"></el-option>
                                        <el-option label="网信安全" value="3"></el-option>
                                        <el-option label="社会保障" value="4"></el-option>
                                        <el-option label="税务税收" value="5"></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="风险线索所属模型ID:" prop="jgFxyjAcquire.fxyjModelId" label-width="150px">
                                    <el-input v-model="riskwarningEdit.jgFxyjAcquire.fxyjModelId" placeholder=""
                                              :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="监管对象类型:" prop="fxyjObjectType" label-width="150px">
                                    <el-input v-model="riskwarningEdit.jgFxyjAcquire.fxyjObjectType" placeholder=""
                                              :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="行政区划代码:" prop="fxyjAreaNumber" label-width="150px">
                                    <el-input v-model="riskwarningEdit.jgFxyjAcquire.fxyjAreaNumber" placeholder=""
                                              :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="行政区划名称:" prop="fxyjAreaName" label-width="150px">
                                    <el-input v-model="riskwarningEdit.jgFxyjAcquire.fxyjAreaName" placeholder=""
                                              :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="监管对象ID:" prop="fxyjObjectId" label-width="150px">
                                    <el-input v-model="riskwarningEdit.jgFxyjAcquire.fxyjObjectId" placeholder=""
                                              :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="监管对象名称:" prop="fxyjObjectName" label-width="150px">
                                    <!--<el-select v-model="riskwarningEdit.jgFxyjAcquire.fxyjObjectName" placeholder="请选择"
                                               :disabled="formDisabled">
                                        <el-option label="行政相对人（组织）" value="1"></el-option>
                                        <el-option label="行政相对人（个人）" value="2"></el-option>
                                        <el-option label="特种设备" value="3"></el-option>
                                        <el-option label="特定产品" value="4"></el-option>
                                        <el-option label="场地场所" value="5"></el-option>
                                        <el-option label="项目工程" value="6"></el-option>
                                        <el-option label="特定行为" value="7"></el-option>
                                        <el-option label="特定活动" value="8"></el-option>
                                    </el-select>-->
                                    <el-input v-model="riskwarningEdit.jgFxyjAcquire.fxyjObjectName" placeholder="" :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="平台名称:" prop="fxyjPlatform" label-width="150px">
                                    <el-input v-model="riskwarningEdit.jgFxyjAcquire.fxyjPlatform" placeholder=""
                                              :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="平台网址:" prop="fxyjWeb" label-width="150px">
                                    <el-input v-model="riskwarningEdit.jgFxyjAcquire.fxyjWeb" placeholder=""
                                              :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="16">
                                <el-form-item label="预警描述:" prop="fxyjDesc" label-width="150px">
                                    <el-input v-model="riskwarningEdit.jgFxyjAcquire.fxyjDesc" placeholder=""
                                              :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="16">
                                <el-form-item label="风险预警详情:" prop="fxyjProps">
                                    <el-input type="textarea" v-model="riskwarningEdit.jgFxyjAcquire.fxyjProps"
                                              placeholder="" :disabled="formDisabled" style="width: 100%;"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="预警级别:" prop="fxyjLevel" label-width="150px">
                                    <el-select v-model="riskwarningEdit.jgFxyjAcquire.fxyjLevel" placeholder="请选择"
                                               :disabled="formDisabled">
                                        <el-option label="高风险" value="0"></el-option>
                                        <el-option label="中高风险" value="1"></el-option>
                                        <el-option label="中风险" value="2"></el-option>
                                        <el-option label="低风险" value="3"></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="预警时间:" prop="fxyjTime" label-width="150px">
                                    <el-date-picker
                                            v-model="riskwarningEdit.jgFxyjAcquire.fxyjTime"
                                            type="date"
                                            value-format="yyyy-MM-dd"
                                            placeholder="选择时间"
                                            style="width: 243px;"
                                            :editable="false"
                                            :disabled="formDisabled">
                                    </el-date-picker>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="其他:" prop="fxyjOthers" label-width="150px">
                                    <el-input v-model="riskwarningEdit.jgFxyjAcquire.fxyjOthers" placeholder=""
                                              :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="预警详情网址:" prop="fxyjDetailUrl" label-width="150px">
                                    <el-input v-model="riskwarningEdit.jgFxyjAcquire.fxyjDetailUrl" placeholder=""
                                              :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </div>
                    <!--接收处置信息-->
                    <div>
                        <el-row>
                            <el-col :span="10" class="tab-title">
                                接收处置信息
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="风险预警传送时间:" prop="fxyjTransmitTime" label-width="150px">
                                    <el-input v-model="riskwarningEdit.jgFxyjAcquire.fxyjTransmitTime" placeholder=""
                                              :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="从应急部发送过来的时间:" prop="yjbSendTime" label-width="150px">
                                    <el-input v-model="riskwarningEdit.jgFxyjAcquire.yjbSendTime" placeholder=""
                                              :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>

                    </div>
                    <!--分发-->
                    <div>
                        <el-row>
                            <el-col :span="10" class="tab-title">
                                分发信息
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="操作人:" prop="jgFxyjFenfa.operatePerson" :rules="rules.operatePerson"
                                              label-width="150px">
                                    <el-input v-model="riskwarningEdit.jgFxyjFenfa.operatePerson" placeholder=""
                                              :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="操作人机构:" prop="jgFxyjFenfa.operateOrg" :rules="rules.operateOrg"
                                              label-width="150px">
                                    <el-input v-model="riskwarningEdit.jgFxyjFenfa.operateOrg" placeholder=""
                                              :disabled="formDisabled"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="处置结果:" prop="jgFxyjFenfa.disposeResult"
                                              :rules="rules.disposeResult" label-width="150px">
                                    <el-select v-model="riskwarningEdit.jgFxyjFenfa.disposeResult" placeholder="请选择"
                                               :disabled="formDisabled">
                                        <el-option label="认领" value="0"></el-option>
                                        <el-option label="分发" value="1"></el-option>
                                        <el-option label="回复" value="2"></el-option>
                                        <el-option label="结束" value="3"></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="分发时间:" prop="jgFxyjFenfa.fenfaTime" :rules="rules.fenfaTime"
                                              label-width="150px">
                                    <el-date-picker
                                            v-model="riskwarningEdit.jgFxyjFenfa.fenfaTime"
                                            type="date"
                                            value-format="yyyy-MM-dd"
                                            placeholder="选择开始时间"
                                            style="width: 243px;"
                                            :editable="false"
                                            :disabled="formDisabled">
                                    </el-date-picker>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="16">
                                <el-form-item label="处置说明:" prop="jgFxyjFenfa.disposeExplain"
                                              :rules="rules.disposeExplain">
                                    <el-input type="textarea" v-model="riskwarningEdit.jgFxyjFenfa.disposeExplain"
                                              placeholder="" :disabled="replyformDisabled"
                                              style="width: 100%;"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="16">
                                <el-form-item label="分发到的机构:" :rules="rules.fenfaList">
                                    <el-select v-model="riskwarningEdit.fenfaList" placeholder="请选择" multiple
                                               collapse-tags @change="selectChange">
                                        <el-option :value="mineStatusValue" style="height: auto">
                                            <el-tree :data="dataOrg" show-checkbox
                                                     :expand-on-click-node="false"
                                                     check-on-click-node
                                                     :default-expand-all="true"
                                                     :check-strictly="true"
                                                     node-key="id" ref="tree" highlight-current :props="defaultProps"
                                                     @check-change="handleCheckChange"></el-tree>
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="22">
                                <div style="float:right;">
                                    <el-button type="primary" size="small" style="width: 60px;height: 30px;"
                                               @click="release()">确定
                                    </el-button>
                                    <el-button type="info" size="small" style="width: 60px;height: 30px;"
                                               @click="dialogEditForm = false;clearForm()">取消
                                    </el-button>
                                </div>
                            </el-col>
                        </el-row>
                    </div>
                </el-form>
            </div>
        </el-dialog>

    </div>
</div>
<script>
    var vm = new Vue({
        el: '#app',
        data() {
            return {
                currentPage: 1,
                pagesize: 10,
                tableTotal: '',
                tableData: [],
                selectForm: {
                    fxyjDomainId: '',
                    fxyjTitle: '',
                    fxyjLevel: '',
                    fxyjObjectName: '',
                    startTime1: '',
                    endTime1: '',
                    startTime: '',
                    endTime: '',
                },
                riskwarningview: {
                    riskwarning: {
                        id: '',
                        fxyjId: '',
                        fxyjDomainId: '',
                        fxyjModelId: '',
                        fxyjObjectType: '',
                        fxyjAreaNumber: '',
                        fxyjAreaName: '',
                        fxyjObjectId: '',
                        fxyjObjectName: '',
                        fxyjPlatform: '',
                        fxyjWeb: '',
                        fxyjDesc: '',
                        fxyjProps: '',
                        fxyjLevel: '',
                        fxyjTime: '',
                        fxyjOthers: '',
                        fxyjDetailUrl: '',
                        fxyjTransmitTime: '',
                        yjbSendTime: '',
                        operatePerson: '',
                        operateOrg: '',
                        disposeResult: '1',
                        getTime: '',
                        disposeExplain: '',
                    },
                    riskwarningChildren: []
                },

                riskwarningEdit: {
                    jgFxyjAcquire: {
                        id: '',
                        fxyjId: '',
                        fxyjDomainId: '',
                        fxyjModelId: '',
                        fxyjObjectType: '',
                        fxyjAreaNumber: '',
                        fxyjAreaName: '',
                        fxyjObjectId: '',
                        fxyjObjectName: '',
                        fxyjPlatform: '',
                        fxyjWeb: '',
                        fxyjDesc: '',
                        fxyjProps: '',
                        fxyjLevel: '',
                        fxyjTime: '',
                        fxyjOthers: '',
                        fxyjDetailUrl: '',
                        fxyjTransmitTime: '',
                        yjbSendTime: '',
                        operatePerson: '',
                        operateOrg: '',
                        disposeResult: '1',
                        getTime: '',
                        disposeExplain: '',
                    },
                    jgFxyjFenfa: {
                        id: '',
                        operatePerson: '',
                        operateOrg: '',
                        disposeExplain: '',
                        disposeResult: '1',
                        fenfaTime: '',
                        fenfaToOrg: '',
                        getId: '',
                    },
                    fenfaList: []
                },

                options: [],
                dialogViewForm: false,
                dialogEditForm: false,
                replyformDisabled: false,
                formDisabled: false,
                selectFormDisabled: false,
                rules: {
                    operatePerson: [{
                        required: true,
                        message: '请输入操作人',
                        trigger: 'blur'
                    }],
                    operateOrg: [{
                        required: true,
                        message: '请输入操作人机构',
                        trigger: 'blur'
                    }],
                    disposeResult: [{
                        required: true,
                        message: '请选择处置结果',
                        trigger: 'blur'
                    }],
                    fenfaTime: [{
                        required: true,
                        message: '请输入分发时间',
                        trigger: 'blur'
                    }],
                    disposeExplain: [{
                        required: true,
                        message: '请输入处置说明',
                        trigger: 'blur'
                    }],
                    fenfaList: [{
                        required: true,
                        message: '请选择分发到机构',
                        trigger: 'blur'
                    }]
                },
                dataOrg: [],
                mineStatus: "",
                mineStatusValue: [],
                defaultProps: {
                    children: "children",
                    label: "deptName"
                }
            }
        },
        mounted() {
            this.getOrg();
            this.getData();
        },
        methods: {
            getData() {
                var pagesize = this.pagesize;
                var pageno = this.currentPage;
                axios({
                    method: 'get',
                    url: '/fxyj/fenfa/getAllDistribute',
                    params: {
                        pageSize: pagesize,
                        pageNo: pageno,
                        fxyjDomainId: this.selectForm.fxyjDomainId,
                        fxyjTitle: this.selectForm.fxyjTitle,
                        fxyjLevel: this.selectForm.fxyjLevel,
                        fxyjObjectName: this.selectForm.fxyjObjectName,
                        startTime1: this.selectForm.startTime1,
                        endTime1: this.selectForm.endTime1,
                        startTime: this.selectForm.startTime,
                        endTime: this.selectForm.endTime
                    }
                })
                    .then(response => {
                        let data = response.data;
                        if (data.code == 200) {
                            let dataInformation = response.data.data.results;
                            this.tableTotal = response.data.data.total;// 数据长度
                            this.tableData = dataInformation;

                        } else {
                            this.$message.error(data.msg);
                        }
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
            },
            /* 列表页搜索 */
            searchForm(selectForm) {
                var pagesize = this.pagesize;
                var pageno = 1;
                var start1 = this.selectForm.startTime1;
                var end1 = this.selectForm.endTime1;
                var count1 = this.checkDate(end1, start1);
                var start = this.selectForm.startTime;
                var end = this.selectForm.endTime;
                var count = this.checkDate(end, start);
                if (count1 < 0 || count < 0) {
                    this.$message.error("开始时间不能大于结束时间")
                } else {
                    axios({
                        method: 'get',
                        url: '/fxyj/fenfa/getAllDistribute',
                        params: {
                            pageSize: pagesize,
                            pageNo: pageno,
                            fxyjDomainId: this.selectForm.fxyjDomainId,
                            fxyjTitle: this.selectForm.fxyjTitle,
                            fxyjLevel: this.selectForm.fxyjLevel,
                            fxyjObjectName: this.selectForm.fxyjObjectName,
                            startTime1: this.selectForm.startTime1,
                            endTime1: this.selectForm.endTime1,
                            startTime: this.selectForm.startTime,
                            endTime: this.selectForm.endTime
                        }
                    })
                        .then(response => {
                            let data = response.data;
                            if (data.code == 200) {
                                let dataInformation = response.data.data.results;
                                this.tableTotal = response.data.data.total;// 数据长度

                                this.tableData = dataInformation;
                            } else {
                                this.$message.error(data.msg);
                            }
                        })
                        .catch(function (error) {
                            console.log(error);
                        });
                }

            },
            /* 列表页重置 */
            resetForm(formName) {
                this.selectForm.fxyjDomainId = '';
                this.selectForm.fxyjTitle = '';
                this.selectForm.fxyjLevel = '';
                this.selectForm.fxyjObjectName = '';
                this.selectForm.startTime1 = '';
                this.selectForm.endTime1 = '';
                this.selectForm.startTime = '';
                this.selectForm.endTime = '';
                this.currentPage = 1;
                this.getData();
            },
            //每页下拉显示数据
            handleSizeChange(size) {
                this.pagesize = size;
                this.getData();
            },
            //点击第几页
            handleCurrentChange(currentPage) {
                this.currentPage = currentPage;
                this.getData();
            },
            // 设置允许填写和不允许填写
            checkDisabled(n) {
                if (n) {
                    this.formDisabled = true;
                    this.replyformDisabled = true;
                } else {
                    this.formDisabled = false;
                    this.replyformDisabled = false;
                }
            },
            //查看
            view(index, row) {
                this.showInformation(index, row);
                this.dialogViewForm = true;
                this.checkDisabled(true);
            },
            // 公共方法--查看
            showInformation(index, row) {
                axios({
                    method: 'post',
                    url: '/fxyj/fenfa/findfenfa',
                    params: {
                        id: row.id
                    }
                })
                    .then(response => {
                        let data = response.data;
                        if (data.code == 200) {
                            this.riskwarningview = response.data.data;
                            //this.clearForm(); // 重置
                        } else {
                            this.$message.error(data.msg);
                        }
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
            },
            //导出
            appovalEx() {
                window.location.href = "/fxyj/export/exportDistribute?fxyjDomainId=" + this.selectForm.fxyjDomainId + "&fxyjTitle="
                    + this.selectForm.fxyjTitle + "&fxyjLevel="
                    + this.selectForm.fxyjLevel + "&fxyjObjectName="
                    + this.selectForm.fxyjObjectName + "&startTime1="
                    + this.selectForm.startTime1 + "&endTime1="
                    + this.selectForm.endTime1 + "&startTime="
                    + this.selectForm.startTime + "&endTime="
                    + this.selectForm.endTime + "&pageNo=1";
            },
            //分发
            distribute(index, row) {
                this.dialogViewForm = false;
                this.dialogEditForm = true;
                this.formDisabled = true;
                this.replyformDisabled = false;
                axios({
                    method: 'post',
                    url: '/fxyj/fenfa/getAcquireById',
                    params: {
                        id: row.id,
                    }
                })
                    .then(response => {
                        let data = response.data;
                        if (data.code == 200) {
                            let rowdata = response.data.data;
                            console.log(rowdata);
                            //this.clearForm(); // 重置
                            this.riskwarningEdit = rowdata;
                        } else {
                            this.$message.error(data.msg);
                        }
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
            },
            //分发提交
            release() {
                this.$refs.riskwarningEdit.validate(valid => {
                    if (valid) {
                        let list = this.riskwarningEdit.fenfaList;
                        if (list == null || list == '' || list.length == 0) {
                            this.$message.error('分发到的机构不能为空');
                            return false;
                        } else {
                            this.$confirm('是否提交，提交后不能修改', '提示', {
                                confirmButtonText: '确定',
                                cancelButtonText: '取消',
                                type: 'warning'
                            }).then(() => {
                                axios({
                                    method: 'post',
                                    url: '/fxyj/fenfa/fenFaSave',
                                    data: this.riskwarningEdit
                                })
                                    .then(response => {
                                        let data = response.data;
                                        if (data.code == 200) {
                                            this.$message({
                                                message: '分发成功',
                                                type: 'success'
                                            });
                                            this.clearForm(); // 重置
                                            this.dialogEditForm = false;
                                            this.getData();
                                        } else {
                                            this.$message.error(data.msg);
                                        }
                                    })
                                    .catch(function (error) {
                                        console.log(error);
                                    });
                            }).catch(() => {
                                this.$message({
                                    message: '已取消提交',
                                    type: 'info'
                                });
                            });

                        }
                    } else {
                        console.log("必填项不能为空！");
                        return false;
                    }
                });
            },
            changeValue() {
                console.log(this.fenfaList);
                // this.fenfaList
            },
            //清空
            clearForm() {
                this.riskwarningEdit.jgFxyjFenfa.operatePerson = '';
                this.riskwarningEdit.jgFxyjFenfa.operateOrg = '';
                this.riskwarningEdit.jgFxyjFenfa.disposeExplain = '';
                this.riskwarningEdit.jgFxyjFenfa.disposeResult = '1';
                this.riskwarningEdit.jgFxyjFenfa.fenfaTime = '';
                this.riskwarningEdit.jgFxyjFenfa.getId = '';
                this.riskwarningEdit.fenfaList = ''
            },
            //获取组织机构
            getOrg() {
                var orgData = '';
                axios.get(appBaseUrl + "/org/getOrg").then(response => {
                    console.log(response.data.data);
                    orgData = JSON.parse(response.data.data);
                    console.log(orgData);
                    // this.dataOrg.push(orgData);
                    this.dataOrg = orgData;
                    console.log(this.dataOrg);
                })
            },
            //select框值改变时候触发的事件
            selectChange(e) {
                var arrNew = [];
                var dataLength = this.mineStatusValue.length;
                var eleng = e.length;
                for (let i = 0; i < dataLength; i++) {
                    for (let j = 0; j < eleng; j++) {
                        if (e[j] === this.mineStatusValue[i].label) {
                            arrNew.push(this.mineStatusValue[i])
                        }
                    }
                }
                this.$refs.tree.setCheckedNodes(arrNew);//设置勾选的值
            },
            handleCheckChange() {
                let res = this.$refs.tree.getCheckedNodes(false, true); //这里两个true，1. 是否只是叶子节点 2. 是否包含半选节点（就是使得选择的时候不包含父节点）
                let arrLabel = [];
                let arr = [];
                res.forEach(item => {
                    arrLabel.push(item.deptName);
                    arr.push(item);
                });
                this.mineStatusValue = arr;
                this.riskwarningEdit.fenfaList = arrLabel;
            },
            checkDate(str1, str2) {
                if (str1 != null && str2 != null) {
                    var reg = /[^\d]+/;
                    var arr1 = str1.split(reg);
                    var arr2 = str2.split(reg);
                    var d1 = new Date(arr1[0], arr1[1], arr1[2]);
                    var d2 = new Date(arr2[0], arr2[1], arr2[2]);
                    return d1 - d2;
                }

            }
        }
    })
</script>
</body>
</html>
